﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;

using System.Text;
using System.Windows.Forms;
using ComponentFactory.Krypton.Toolkit;

namespace SceneEditor
{
    public partial class NumericEntryForm : KryptonForm
    {
        public NumericEntryForm()
        {
            InitializeComponent();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
            Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
            Close();
        }

        private void tbText_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                btnOk_Click(null, null);
            }
        }

        private void TextEntryForm_Shown(object sender, EventArgs e)
        {
            tbValue.Location = new Point(lblText.Right + 6, tbValue.Location.Y);
            Size = new Size(tbValue.Right + 2 * kryptonPanel1.Padding.Right, Size.Height);
        }
    }
}
